<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../../static/admin/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/admin/css/admin.css"/>
</head>
<body>
<div class="layui-tab page-content-wrap">
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form"  style="width: 90%;padding-top: 20px;">

                <div class="layui-form-item">
                    <label class="layui-form-label" >项目编码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="xiangmubianma" required lay-verify="required" placeholder="请输入项目编码" autocomplete="off" class="layui-input" id="xiangmubianma">
                    </div>

                    <label class="layui-form-label">项目名称</label>
                    <div class="layui-input-inline">
                        <input type="text" name="xiangmumingcheng" required lay-verify="required" placeholder="请输入项目名称" autocomplete="off" class="layui-input" id="xiangmumingcheng">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">具体地址</label>
                    <div class="layui-input-inline">
                        <input type="text" name="xiangmudizhi" id="xiangmudizhi" required lay-verify="required" placeholder="请输入具体地址" autocomplete="off" class="layui-input">
                    </div>
                    <label class="layui-form-label">物业公司名称</label>
                    <div class="layui-input-inline">
                        <input type="text" name="wuyegongsimingcheng" id="wuyegongsimingcheng" required lay-verify="required" placeholder="请输入物业公司名称" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">使用面积</label>
                    <div class="layui-input-inline">
                        <input type="text" name="shiyongmianji" id="shiyongmianji" required lay-verify="required" placeholder="请输入使用面积(m2)" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea name="beizhu"  id="beizhu" placeholder="请输入内容" class="layui-textarea"></textarea>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-inline">
                        <select name="qiyongzhuangtai" lay-verify="required" id="qiyongzhuangtai">
                            <option value="1">启用</option>
                            <option value="2">停用</option>
                        </select>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formxinxi">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
<script src="../../../static/admin/layui2/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['form','jquery','element','layer'], function(){
        var form = layui.form;
        var $=layui.jquery;
        var element=layui.element;
        var layer=layui.layer;
        form.render();
        form.on('submit(formxinxi)',function (data) {
            $.ajax({
                url: "/addXiangMu",
                type: "POST",
                data:{"xiangmubianma":data.field.xiangmubianma,
                    "xiangmumingcheng":data.field.xiangmumingcheng,
                    "xiangmudizhi":data.field.xiangmudizhi,
                    "wuyegongsimingcheng":data.field.wuyegongsimingcheng,
                    "shiyongmianji":data.field.shiyongmianji,
                    "beizhu":data.field.beizhu,
                    "qiyongzhuangtai":data.field.qiyongzhuangtai
                },
                dataType: 'json',
                success:function (res) {
                    layer.msg(res.msg),
                        setTimeout(function(){
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);//关闭弹出层
                            parent.location.reload();//重新加载父页面表格
                        }, 2100);
                }
            })
            return false;
        })

    });


</script>
</body>
</html>